package com.nuoniu.sibanyun.mapper.project;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.project.SysRdtField;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 数据库字段表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2021-06-05
 */
public interface SysRdtFieldMapper extends BaseMapper<SysRdtField> {

    @Select("SELECT COLUMN_NAME AS 'field_name_en',COLUMN_COMMENT AS 'field_name_cn',IF(IS_NULLABLE = 'YES',1,0) AS 'is_not_null',DATA_TYPE AS 'type',COLUMN_DEFAULT AS 'default_value',COLUMN_COMMENT AS'remarks'" +
            " FROM information_schema.COLUMNS WHERE table_schema = 'sibanyun_new' AND table_name = #{formNameEn}")
    List<SysRdtField> getByForm(String formNameEn);
}
